package chapter03.Example01;

class Student1{
    String name;                         //声明姓名属性
    void read(){
        System.out.println("大家好，我是"+name);
    }
}
public class Example01 {
    public static void main(String[] args){
        Student1 stu1 = new Student1();  //创建第一个Student对象
        Student1 stu2 = new Student1();  //创建第二个student对象
        stu1.name = "小明";               //为stu1对象的name属性赋值
        stu1.read();                     //调用对象方法
        stu2.name = "小华";
        stu2.read();
    }
}
